import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace PhotographyOrderApi {
  /** 摄影服务订单信息 */
  export interface PhotographyOrder {
    id: number; // 
    orderId?: string; // 订单号
    photographerCode?: string; // 摄影师编码
    customerId?: string; // 客户ID
    shootingTime?: string | Dayjs; // 拍摄时间
    shootingLocation: string; // 拍摄地点
    serviceAmount: number; // 服务金额
    paidAmount: number; // 已支付金额
    photoCount: number; // 照片数量
    retouchCount: number; // 精修数量
    rating: number; // 评分
    remark: string; // 备注
    status: string; // 订单状态
  }
}

/** 查询摄影服务订单分页 */
export function getPhotographyOrderPage(params: PageParam) {
  return requestClient.get<PageResult<PhotographyOrderApi.PhotographyOrder>>('/wedding/photography-order/page', { params });
}

/** 查询摄影服务订单详情 */
export function getPhotographyOrder(id: number) {
  return requestClient.get<PhotographyOrderApi.PhotographyOrder>(`/wedding/photography-order/get?id=${id}`);
}

/** 新增摄影服务订单 */
export function createPhotographyOrder(data: PhotographyOrderApi.PhotographyOrder) {
  return requestClient.post('/wedding/photography-order/create', data);
}

/** 修改摄影服务订单 */
export function updatePhotographyOrder(data: PhotographyOrderApi.PhotographyOrder) {
  return requestClient.put('/wedding/photography-order/update', data);
}

/** 删除摄影服务订单 */
export function deletePhotographyOrder(id: number) {
  return requestClient.delete(`/wedding/photography-order/delete?id=${id}`);
}


/** 导出摄影服务订单 */
export function exportPhotographyOrder(params: any) {
  return requestClient.download('/wedding/photography-order/export-excel', { params });
}

